package data;

public class AggregatedEdge extends Edge{
	
	private static final double INITIAL_TRESHOLD = 0.0003;

	private int numbers;
	
	private double treshold;

	public void setTreshold(double treshold) {
		this.treshold = treshold;
	}

	public double getTreshold() {
		return treshold;
	}

	public void setNumbers(int numbers) {
		this.numbers = numbers;
	}

	public int getNumbers() {
		return numbers;
	}
	
	public void deriveFromEdge(Edge ed){
		this.setFrom(new Location());
		this.getFrom().setLatitude(ed.getFrom().getLatitude());
		this.getFrom().setLongitude(ed.getFrom().getLongitude());
		this.getFrom().setElevation(ed.getFrom().getElevation());
		this.setTo(new Location());
		this.getTo().setLatitude(ed.getTo().getLatitude());
		this.getTo().setLongitude(ed.getTo().getLongitude());
		this.getTo().setElevation(ed.getTo().getElevation());
		this.setDistance(ed.getDistance());
		this.numbers = 1;
		this.treshold = (INITIAL_TRESHOLD);
	}
	
	public void cloneAggregatedEdge(AggregatedEdge ed){
		this.setFrom(new Location());
		this.getFrom().setLatitude(ed.getFrom().getLatitude());
		this.getFrom().setLongitude(ed.getFrom().getLongitude());
		this.getFrom().setElevation(ed.getFrom().getElevation());
		this.setTo(new Location());
		this.getTo().setLatitude(ed.getTo().getLatitude());
		this.getTo().setLongitude(ed.getTo().getLongitude());
		this.getTo().setElevation(ed.getTo().getElevation());
		this.setDistance(ed.getDistance());
		this.numbers = ed.getNumbers();
		this.treshold = ed.getTreshold();
	}

	
}
